package svc

import (
	"github.com/zeromicro/go-zero/rest"
	"github.com/zeromicro/go-zero/zrpc"
	"technician/internal/config"
	"technician/internal/middleware"
	"technician_srv/technician"
)

type ServiceContext struct {
	Config        config.Config
	AuthToken     rest.Middleware
	TechnicianSrv technician.SevriceClient
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:        c,
		AuthToken:     middleware.NewAuthTokenMiddleware().Handle,
		TechnicianSrv: technician.SevriceClient(zrpc.MustNewClient(c.TechnicianSrv)),
	}
}
